"""
参数化引入案例
"""
import unittest


def add(x, y):
    return x + y


class TestAdd(unittest.TestCase):
    def test_add(self):
        test_data = [(1, 1, 2), (1, 1, 1), (0, 0, 0)]

        for x, y, expect in test_data:
            print("x={} y={} expect={}".format(x, y, expect))
            result = add(x, y)
            self.assertEqual(expect, result)

    # def test_add_01(self):
    #     result = add(1, 1)
    #     self.assertEqual(2, result)
    #
    # def test_add_02(self):
    #     result = add(1, 0)
    #     self.assertEqual(1, result)
    #
    # def test_add_03(self):
    #     result = add(0, 0)
    #     self.assertEqual(0, result)

